package jp.eisbahn.mgapi.api.voice;

import java.text.ParseException;

import org.json.simple.JSONObject;

/**
 * The model class to have information about the status.
 * @author Yoichiro Tanaka
 */
public class Status extends AbstractVoiceModel {

    /**
     * Initialize this instance.
     * @param original The json object to have information about the status.
     */
    protected Status(final JSONObject original) {
        super(original);
    }

    /**
     * Retrieve the reply count.
     * @return The count value.
     */
    public final int getReplyCount() {
        return getPropertyInt("reply_count");
    }

    /**
     * Retrieve the favorite count.
     * @return The count value.
     */
    public final int getFavoriteCount() {
        return getPropertyInt("favorite_count");
    }

    /*
     * (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public final String toString() {
        String createAt;
        try {
            createAt = getCreatedAt().toString();
        } catch (ParseException e) {
            createAt = e.getMessage();
        }
        return "Status [getReplyCount()=" + getReplyCount()
                + ", getFavoriteCount()=" + getFavoriteCount() + ", getId()="
                + getId() + ", getCreatedAt()=" + createAt
                + ", getText()=" + getText() + ", getUser()=" + getUser() + "]";
    }

}
